import request from "@/plugins/request";

var pre = "";
if (process.env.NODE_ENV !== "development") {
  pre = "/api/sa/eshop";
}

// 批量保存商品评价
export function commentSave(data) {
  return request({
    url: `${pre}/goods-comment/save`,
    method: "post",
    data,
  });
}

// 保存网点评分
export function networkSave(data) {
  return request({
    url: `${pre}/network-comment/save`,
    method: "post",
    data,
  });
}

// 商品评价详情
export function commentGet(data) {
  return request({
    url: `${pre}/goods-comment/get?goodsCommentId=${data}`,
    method: "get",
  });
}

export function goodsPage(data) {
  return request({
    url: `${pre}/goods-comment/goods-id/page`,
    method: "post",
    data,
  });
}

// 根据商品标识分页查询商品评价
export function commentPage(data) {
  return request({
    url: `${pre}/goods-comment/my/page`,
    method: "post",
    data,
  });
}

// 保存商品追加评价
export function saveGoodsAddComment(data) {
  return request({
    url: `${pre}/goods-comment/add-comment/save`,
    method: "post",
    data,
  });
}
